/*
 * @Author: shawnxiao
 * @Date: 2021-07-06 14:16:36
 * @LastEditTime: 2021-07-23 10:28:17
 * @FilePath: /project/src/components/ModelShow/index.tsx
 */
import React from 'react'
import { Modal } from 'antd'
import {CloseOutlined } from '@ant-design/icons'
import './index.less'

interface ArgsProps {
  title?: string;
  value?: any;
  okText?: string;
  className?: string;
  callback?: Function;
}

function ModelShow(args:ArgsProps) {
  Modal.info({
    title: args?.title,
    width: '50%',
    content: <div dangerouslySetInnerHTML={{ __html: args.value ? args.value : '暂无建议' }} />,
    okText: args?.okText || '确定',
    className: args?.className || 'custom-model-show',
    mask: false,
    closable: true,
    cancelButtonProps: 'test' as any,
    closeIcon: <CloseOutlined />,
    onOk() {
      args?.callback && args.callback()
    }
  })
}

export default ModelShow
